import QRCode from 'qrcode';
import JsBarcode from 'jsbarcode'
 
 
export function  drawBarcode2 (canvas, str, width,height,fontsize) {
  JsBarcode(canvas, str, {
    format: 'CODE128',
    displayValue: true,
    fontOptions:'bold ',
    fontSize: fontsize,
    width: width,
    height: height,
    margin: 0,
    background: '#ffffff',
    lineColor: '#000000'
  })
}
export function drawQRCode2(text, canvas,w,h) {  
  // 调用QRCode库生成二维码
  QRCode.toCanvas(canvas, text,{width: w,height: h}, function(error) {
    if (error) {
      console.error(error);
    }  
  }); 
}